package com.gome.wechat.program.service.impl;

import com.gome.wechat.program.dao.GroupActivityRepo;
import com.gome.wechat.program.entity.GroupActivity;
import com.gome.wechat.program.entity.GroupActivityUser;
import com.gome.wechat.program.service.GroupActivityService;
import com.gome.wechat.program.service.GroupActivityUserService;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * Created by liwei113 on 2017/10/31 0031.
 */
@Service
public class GroupActivityServiceImpl implements GroupActivityService {

    @Autowired
    GroupActivityRepo groupActivityRepo;
    

    @Override
    public GroupActivity save(GroupActivity groupActivity) {
        return groupActivityRepo.save(groupActivity);
    }
    
    
    public List<GroupActivity> getListInActivityIds(List<Long> activityIds){
    	return groupActivityRepo.getListInActivityIds(activityIds);
    }


	public List<GroupActivity> getGroupActivityByPublisherId(Long publisherId) {
		return groupActivityRepo.getListByPublisherId(publisherId);
	}


	@Override
	public List<GroupActivity> getGroupActivityByCoordinate(Double longitudeLeft, Double longitudeRight,
															Double latitudeUp, Double latitudeDown) {
		// TODO Auto-generated method stub
		return groupActivityRepo.getGroupActivityByCoordinate(longitudeLeft, longitudeRight, latitudeUp, latitudeDown);
	}


	public GroupActivity findById(Long id) {
		GroupActivity groupActivity = groupActivityRepo.findOne(id);
		return groupActivity;
	}

	public List<GroupActivity> getGroupActivityByTypeTwoAndLimitOne(){
		return groupActivityRepo.getGroupActivityByTypeTwoAndLimitOne();
	}
}
